]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ShellUserVerifier: Add method to check if the service name is fingerprint
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Mon, 8 Feb 2021 16:07:45 +0000 (17:07 +0100)
committerRay Strode <halfline@gmail.com>
Mon, 15 Feb 2021 16:58:50 +0000 (16:58 +0000)
We have multiple places where we check if we're handling a fingerprint
event, so let's add a common public function so that it can be used also
by the authPrompt.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1652>

js/gdm/util.js

index a98d63509b70c1c77ead1f768900d09d6b65dcb6..c53fbd21762aafedd44937f7cae72723e438a1b3 100644 (file)
@@ -474,6 +474,11 @@ var ShellUserVerifier = class {
         return serviceName == this._defaultService;
     }
 
+    serviceIsFingerprint(serviceName) {
+        return this._fingerprintReaderType !== FingerprintReaderType.NONE &&
+            serviceName === FINGERPRINT_SERVICE_NAME;
+    }
+
     _updateDefaultService() {
         if (this._settings.get_boolean(PASSWORD_AUTHENTICATION_KEY))
             this._defaultService = PASSWORD_SERVICE_NAME;
@@ -527,8 +532,7 @@ var ShellUserVerifier = class {
     _onInfo(client, serviceName, info) {
         if (this.serviceIsForeground(serviceName)) {
             this._queueMessage(info, MessageType.INFO);
-        } else if (serviceName == FINGERPRINT_SERVICE_NAME &&
-            this._fingerprintReaderType !== FingerprintReaderType.NONE) {
+        } else if (this.serviceIsFingerprint(serviceName)) {
             // We don't show fingerprint messages directly since it's
             // not the main auth service. Instead we use the messages
             // as a cue to display our own message.